import 'package:get/get.dart';
import 'package:sweetim/const/const.dart';
import 'package:sweetim/model/member_info.dart';
import 'package:sweetim/service/api_service.dart';

class LoginService extends GetConnect {
  final ApiService _apiService = Get.find();

  Future<MemberInfo?> login(String phone, String pwd) async {
    var resp = await _apiService.post0(loginUrl, {
      "password" : pwd,
      "phone" : phone
    });
    if(resp == null) {
      return null;
    }

    return MemberInfo.fromJson(resp);
  }

}